package com.leyou.item.service.controller;

import com.leyou.common.bean.Result;
import com.leyou.item.service.service.UploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author zqq
 * @ClassName UploadController
 * @Description
 * @date 2020/3/16-10:15
 */
@Api(value = "UploadController",description = "图片上传接口")
@RestController
@RequestMapping("upload")
public class UploadController {

    @Autowired
    private UploadService uploadService;

    @PostMapping("image")
    @ApiOperation(value = "图片上传", notes = "图片上传")
    public Result<String> uploadImage(@RequestParam("file") MultipartFile file){
        return this.uploadService.upload(file);
    }
}
